<?php

namespace App\Containers\AppSection\Pledge\Observers;

use App\Containers\AppSection\Pledge\Models\Property;
use App\Ship\Parents\Observers\Observer;

class PropertyObserver extends Observer
{
    public function deleted(Property $model)
    {
        if (!empty($model->apartment)) {
            $model->apartment->delete();
        }
        if (!empty($model->house)) {
            $model->house->delete();
        }
        if (!empty($model->premise)) {
            $model->premise->delete();
        }
        if (!empty($model->land)) {
            $model->land->delete();
        }
        if (!empty($model->building)) {
            $model->building->delete();
        }
    }
}
